var CompanyPhone = {
	editPhone: function(idphone) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "company/phone/edit/" + idphone,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	processPhone: function() {
		ajax({
		  url: baseURL + "company/phone/" + ($('#idphone').val() ? 'update' : 'insert'),
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	deletePhone: function(idphone) {
		ajax({
		  url: baseURL + "company/phone/delete",
		  cache: false,
		  type: "POST",
		  data: 'id=' + idphone,
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	getPhoneGrid: function() {
		ajax({
			  url: baseURL + "company/phone",
			  cache: false,
			  type: "POST",
			  data: $('#ajax_form').serialize(),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridPhone').html(data);
			  }
			});
	}
};